<%@ page import="com.oval.util.OvalTools"%>
<script>
<%
     String contextPath_x = request.getContextPath();

%>
  function  deleteHistoryCookie()
  {
          top.left.deleteHistoryCookie()
  }
  function setHistoryCookie(name,value)
  {
        top.left.setHistoryCookie(name,value);
  }
  var  history_length = Number(getCookie("history_length"));
  var  history_url  = getCookie("history_url");
  var  current_url  = "<%=JspHelper.filterNull(request.getRequestURI())%>" ;
  if(isEmpty(history_length) ||   current_url!= history_url)
  {
       history_length = history.length;
       setHistoryCookie('history_length',history_length);
       setHistoryCookie('history_url',current_url);
   }
   function  getHistory(){
        return history.length;
   }
  function page_back()
  {  /* alert("currunt_local=" + history.length + "oldlocal=" + history_length );
      alert("cookie=" + document.cookie);
       var  error_length = Number(getCookie("error_length"));
      alert("error_length=" + error_length);
       if(isEmpty(error_length)){
             error_length=0;
       }

       var  temphistory_length = Number(getCookie("temphistory_length"));
       if(isEmpty(temphistory_length)){
             temphistory_length=0;
       }
       alert("temphistory_length=" + temphistory_length);
       if( (history.length- temphistory_length !=1 ) ){

             error_length=0;
             alert("error_length_new=" + error_length);
       }
       alert("error_length=" + error_length);
       var  num = history_length - history.length -1 + error_length ;

       alert("num="+num );

       deleteHistoryCookie("history_length") ;
       top.left.deleteCookie("temphistory_length") ;
       deleteHistoryCookie("history_url") ;
       deleteHistoryCookie("error_length") ;
       error_length = Number(getCookie("error_length"));
       alert("error_length=" + error_length);
       deleteHistoryCookie("error_length") ;
       alert("cookie=" + document.cookie);
       setHistoryCookie("error_length",0) ;
       alert("cookie=" + document.cookie);
       */

       location.href = "<%=contextPath_x%>/BackPage.jsp?<%= OvalTools.randomURL()%>"
      // history.go(num);
  }

</script>
